package com.yuyue.springFramework.note11.entity.springCode1;

import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

@Component
public class UserRegisterEventListener {
    @EventListener
    public void sendEmail(UserRegisterEvent event){
        System.out.println(Thread.currentThread());
        System.out.println(String.format("[%S]发送邮件成功！", event.getUserName()));
    }

    @EventListener
    public void sendCompon(UserRegisterEvent event){
        System.out.println(Thread.currentThread());
        System.out.println(String.format("[%S]发送优惠券成功！", event.getUserName()));
    }
}
